import request from "../utils/request";
import {userType} from "./user.ts";
import {CompanyType} from "./companies.ts";
import {serverType} from "./serverTypes.ts";


export type houseWorkType =  {
    readonly id: string
    address:string
    serverTime:Date
    isCount:number
    readonly userId:string
    readonly companyId:string
    readonly serverId:string
    user:userType
    company:CompanyType
    server:serverType
}


export const getHouseWorkList = () => {
    return request<houseWorkType[]>({
        method: "GET",
        url: "housework"
    })
}

export const getHouseWorkListById = (id:string) => {
    return request<houseWorkType[]>({
        method: "GET",
        url: `housework/user/${id}`
    })
}